class DEMO:
    """
    常量
    """
    def __init__(self, v, _type):
        if not isinstance(v, dict):
            self._value = {_type: v}
        else:
            self._value = v

    def __or__(self, other):
        return DEMO(self.value | other.value, '_')

    @property
    def value(self):
        return self._value

    def __contains__(self, item):
        for _key in item.value.keys():
            _value = item.value[_key]
            if _key in self._value.keys():
                if self._value[_key] == _value:
                    pass        # 可以
                else:
                    return False
            else:
                return False
        return True

    def __eq__(self, other):
        return True if self._value == other.value else False

a = DEMO(1, "a")
print(a.value)
b = DEMO(2, "b")
c = DEMO(3, "b")

print(((a | b) | c).value)
print(a in (a|b))
print(a == a)